/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Rdf;

import NodeManager.Node;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Resource;

/**
 *
 * @author Sean
 */
public class RdfReader {

    public static Node GetNode(Model model, String nodeName) throws Exception {

        if (model == null) {
            throw new IllegalArgumentException("Model cannot be null");
        }
        if (nodeName == null) {
            throw new IllegalArgumentException("nodeName cannot be null");
        }

        Resource nodeResource = model.getResource(Global.Data.BaseURI + nodeName);
        String NodeLocation = nodeResource.getProperty(RdfCommon.CreateProperty("NodeLocation")).getString();
        return new Node(nodeName, NodeLocation);

    }
}
